﻿using NET6.WebAPI.Attributes;
using System.ComponentModel;

namespace NET6.WebAPI.Enums
{
    public class HttpEnum { }

    /// <summary>
    /// 接口响应码枚举
    /// </summary>
    public enum HttpResponseCode
    {
        [Description("操作成功")]
        [BoolValue(true)]
        OperateSuccess = 200,

        [Description("获取成功")]
        [BoolValue(true)]
        QuerySuccess = 201,

        [Description("插入成功")]
        [BoolValue(true)]
        InsertSuccess = 202,

        [Description("修改成功")]
        [BoolValue(true)]
        ModifySuccess = 203,

        [Description("删除成功")]
        [BoolValue(true)]
        DeleteSuccess = 204,

        [Description("重置成功")]
        [BoolValue(true)]
        ResetSuccess = 205,

        [Description("审核成功")]
        [BoolValue(true)]
        ExamineSuccess = 206,

        [Description("恢复成功")]
        [BoolValue(true)]
        RecoverSuccess = 207,

        [Description("获取令牌成功")]
        [BoolValue(true)]
        TokenSuccess = 208,

        [Description("邮件发送成功")]
        [BoolValue(true)]
        MessageSuccess = 209,

        [Description("操作失败")]
        [BoolValue(false)]
        OperateFail = 300,

        [Description("获取失败")]
        [BoolValue(false)]
        QueryFail = 301,

        [Description("插入失败")]
        [BoolValue(false)]
        InsertFail = 302,

        [Description("修改失败")]
        [BoolValue(false)]
        ModifyFail = 303,

        [Description("删除失败")]
        [BoolValue(false)]
        DeleteFail = 304,

        [Description("重置失败")]
        [BoolValue(false)]
        ResetFail = 305,

        [Description("审核失败")]
        [BoolValue(false)]
        ExamineFail = 306,

        [Description("恢复失败")]
        [BoolValue(false)]
        RecoverFail = 307,

        [Description("获取令牌失败")]
        [BoolValue(false)]
        TokenFail = 308,

        [Description("邮件发送失败")]
        [BoolValue(false)]
        MessageFail = 309
    }

    /// <summary>
    /// 异常响应码枚举
    /// </summary>
    public enum ExceptionResponseCode
    {
        [Description("未知错误")]
        [BoolValue(false)]
        Unknown = 0,

        [Description("记录不存在")]
        [BoolValue(false)]
        NotExists = 101,

        [Description("名称重复")]
        [BoolValue(false)]
        NameDuplicate = 102,

        [Description("无效的业务状态")]
        [BoolValue(false)]
        InvalidStatus = 103,

        [Description("请求第三方接口失败")]
        [BoolValue(false)]
        RequestFail = 105
    }
}
